package com.example.testspringcloudkafka.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    KafkaTemplate<String,  String> template;

    @GetMapping("message/send")
    public void test(String message) {
        template.send("myTopic", "你好");
    }
}
